<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Hamilton Admin</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<!-- load the dojo toolkit base -->
		<style type="text/css">	
		
		@import "/lib/dojo-1.3.0-src/dojo/resources/dojo.css";
		@import "/lib/dojo-1.3.0-src/dijit/themes/dijit.css";
		@import "/lib/dojo-1.3.0-src/dijit/themes/nihilo/nihilo.css";
		@import "/lib/dojoc/form/themes/TimestampTextBox.css";
			@import "/lib/dojo-1.3.0-src/dojox/editor/plugins/resources/editorPlugins.css";
			@import "/lib/dojo-1.3.0-src/dojox/layout/resources/ExpandoPane.css";
			@import "/lib/dojoc/form/themes/TimestampTextBox.css";


		label	{ display: block; margin-top: 10px }
		.dijitTextBox	{ padding: 3px }
			html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow:hidden }
		</style>
		<script type="text/javascript">
			passthrough = function(msg){
				//for catching messages from Flash
				if(window.console){
					console.log(msg);	
				}
			}
		</script>
		<script type="text/javascript" src="../lib/dojo-1.3.0-src/dojo/dojo.js" djConfig="locale: 'se', isDebug: true, parseOnLoad: true, usePlainJson: true"></script>
		<script type="text/javascript">
			dojo.registerModulePath("slipstream", "../../slipstream");
			dojo.registerModulePath("dojoc", "../../dojoc");
			dojo.require("dijit.Editor");
			dojo.require("dijit.layout._TemplatedLayoutWidget");
			dojo.require("dijit.layout.ContentPane");
			dojo.require("dijit.layout.TabContainer");
			dojo.require("dijit.layout.BorderContainer");
dojo.require("dojox.form.FileUploader");
			dojo.require("dojox.layout.ExpandoPane");
			dojo.require("dojox.editor.plugins.UploadImage");
			/*dojo.require("dijit.layout.AccordionContainer");
			dojo.require("dojoc.form.TimestampTextBox");
			dojo.require("dijit.form.TextBox");
			dojo.require("dojox.layout.ExpandoPane");
			dojo.require("dijit._editor.plugins.FontChoice");
			dojo.require("dijit._editor.plugins.LinkDialog");
			dojo.require("dojox.editor.plugins.TablePlugins");
			dojo.require("slipstream.view.Entry");
			dojo.require("dojox.data.ClientFilter");
			dojo.require("dojox.data.JsonRestStore");*/
			
			dojo.declare('testwidget',[dijit.layout._TemplatedLayoutWidget],{
				templateStringOld: "<div class='temp' style='overflow: hidden; width: 100%; height: 100%; '><div dojoType='dijit.layout.BorderContainer' design='sidebar'>"+
								"<div region='left' width='200px' splitter='true' dojoType='dijit.layout.ContentPane' doLayout='false'>annat</div>"+
								"<div region='center' dojoType='dijit.layout.ContentPane'><div dojoType='dijit.Editor'><p>test</p></div></div>"+
								"</div></div>",
				templateString: "<div dojoAttachPoint='containerNode' class='temp' style='width: 100%; height: 100%; overflow: hidden'><div dojoType='dijit.layout.BorderContainer' design='sidebar'>"+
								"<div region='left' width='200px' splitter='true' dojoType='dojox.layout.ExpandoPane'>annat</div>"+
								"<div region='top' dojoType='dijit.layout.ContentPane' splitter='true'></div>"+
								"<div region='center' dojoType='dijit.layout.ContentPane' style='overflow: hidden' ><div id='ed1' jsId='jed1' dojoType='dijit.Editor'"+
								" extraPlugins=\"[{name: 'dojox.editor.plugins.UploadImage', command: 'uploadImage', uploadUrl:'/images/UploadFile.php', downloadPath:'/images/', tempImageUrl:'/gui/busy.gif'}]\""+
								"><p>test</p></div></div>"+
								"</div></div>",
				templateStringnew: "<div class='temp' style='overflow: hidden'><div region='center' dojoType='dijit.layout.ContentPane' style='overflow: hidden'><div id='ed1' jsId='jed1' height='200px' dojoType='dijit.Editor'"+
								" plugins=\"[{name: 'dojox.editor.plugins.UploadImage', command: 'uploadImage', uploadUrl:'/images/UploadFile.php', downloadPath:'/images/', tempImageUrl:'/gui/busy.gif'}]\""+
								"><p>test</p></div></div></div>",
				widgetsInTemplate: true,
				doLayout: true,
				baseClass: "dijitContentPane",
				
				postCreate: function(){
					console.debug(this);
					this.inherited(arguments);
				},
				layout: function(){
					if(this.getChildren().length==1){
						console.debug('ContentBox:',this._contentBox);
						this.getChildren()[0].resize(this._contentBox);
						//this.getChildren()[0].resize();
					} else {
						console.error('Can only contain one child, have '+this.getChildren().length,this);
					}
				},
				/*
				layout: function(){
					this._scheduleLayout();
				},

				_onShow: function(){
					if(this._needLayout){
						this._layoutChildren();
					}
			
					if(this.onShow){
						this.onShow();
					}
				},

				startup: function(){
					if(this._started){ return; }
			
					dojo.forEach(this.getChildren(), function(child){
						child.startup();
					});
					if(this.doLayout){
						this._checkIfSingleChild();
					}
					if(!this._singleChild || !dijit._Contained.prototype.getParent.call(this)){
						this._scheduleLayout();
						}
					this.inherited(arguments);
				},
				
				resize: function(){
					return dijit.layout.ContentPane.prototype.resize.apply(this, arguments);
				},
				
				_layoutChildren: function(){
					return dijit.layout.ContentPane.prototype._layoutChildren.apply(this, arguments);
				},
				
				_scheduleLayout: function(){
					return dijit.layout.ContentPane.prototype._scheduleLayout.apply(this, arguments);
				},
				
				_isShown: function(){
					return dijit.layout.ContentPane.prototype._isShown.apply(this, arguments);
				},
				
				_checkIfSingleChild: function(){
					return dijit.layout.ContentPane.prototype._checkIfSingleChild.apply(this, arguments);
				}*/
			});
		</script>
	</head>
	<body class="nihilo">
		<div dojoType='dijit.layout.BorderContainer' design='headline' style="width: 100%; height: 100%">
			<div title='top' width='200px' splitter='true' dojoType='dijit.layout.ContentPane' region="top"></div>
			<div region="center" dojoType="dijit.layout.TabContainer">
				<div title='left' dojoType='dijit.layout.ContentPane'></div>
				<div jsId="obj" title="test" dojoType="testwidget" ></div>
			</div>
			<div title='top' width='200px' splitter='true' dojoType='dijit.layout.ContentPane' region="bottom"></div>
		</div>
	</body>
</html>
